<?php

session_start();

//store to test if they *were* logged in
$old_user==$_SESSION['valid_user'];
unset($_SESSION['valid_user']);
session_destroy();
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Log out</title>
</head>

<body>
<h1>Log Out</h1>
<?php
if(!empty($old_user))
{
	echo' Logged Out.<br />';
}
else
{
	//if they weren't logged in but come to this page somehow
	echo'You were not logged in, and so have not been logged out.<br/>';
}
?>
<a href="authmain.php">Back to Registered User Page</a>
</body>
</html>